<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<form action="" method="post" novalidate>
{#    <p>第一种渲染方式:代码书写少，封装程度太高 不便于后续的扩展</p>#}
{#    {{ form_obj.as_p }}#}
{#    {{ form_obj.as_table }}#}
{#    {{ form_obj.as_ul }}#}
{#    <p>第二种</p>#}
{#    <p>{{ form_obj.username.label }}{{ form_obj.username }}</p>#}
{#    <p>{{ form_obj.password.label }} {{ form_obj.password }}</p>#}
{#    <p>{{ form_obj.email.label }} {{ form_obj.email }}</p>#}

    <p>第三章渲染方式(推荐使用)</p>
    {% for foo in form_obj %}
        <p>{{ foo.label }}{{ foo }}{{ foo.errors.0 }}</p>
    {% endfor %}
    <input type="submit" class="btn btn-success">
</form>
</body>
</html>